﻿<!-- This control supports drag and drop of photo files -->
<UserControl
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    x:Class="Microsoft.FamilyShow.NewUserControl"
    Width="350"
    AllowDrop="True" Drop="AvatarPhoto_Drop">
  <StackPanel>

    <!-- Header -->
    <Border x:Name="Header" Background="{DynamicResource BackgroundBrush}" BorderBrush="{DynamicResource BorderBrush}" BorderThickness="1,1,1,0" CornerRadius="5,5,0,0">
      <TextBlock Text="Add a family member" TextWrapping="Wrap" Margin="15,5,10,5" Foreground="{DynamicResource HeaderFontColor}" FontSize="18" VerticalAlignment="Center" FontWeight="Bold" x:Name="HeaderTextBlock"/>
    </Border>

    <!-- Content -->
    <Border BorderBrush="{DynamicResource BorderBrush}" BorderThickness="1,1,1,1">
      <Grid Margin="0,0,0,0" x:Name="ContentGrid" Background="{DynamicResource InputBackgroundBrush}">
        <Grid.ColumnDefinitions>
          <ColumnDefinition Width="0.5*"/>
          <ColumnDefinition Width="0.5*"/>
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
          <RowDefinition Height="Auto"/>
          <RowDefinition Height="Auto"/>
          <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>

        <StackPanel Orientation="Horizontal" Grid.ColumnSpan="2">
          <Border Margin="15,15,15,15" BorderBrush="{DynamicResource BorderBrush}" BorderThickness="1,1,1,1">
            <Grid x:Name="AvatarGrid" MouseDown="AvatarGrid_MouseDown">
              <TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" Text="Drag a photo here" Width="80" Style="{DynamicResource AvatarTextBlockStyle}" TextAlignment="Center" TextWrapping="WrapWithOverflow" Foreground="{DynamicResource InputFontColor}"/>
              <Image x:Name="AvatarPhoto" Height="75" Width="80" Source="{Binding Path=Avatar, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
            </Grid>
          </Border>
          <StackPanel Grid.Row="0" Margin="15,15,0,15">
            <Label Content="_Gender" Target="{Binding ElementName=MaleRadioButton, Mode=OneWay}" Foreground="{DynamicResource InputFontColor}"/>
            <RadioButton Content="Male" x:Name="MaleRadioButton" IsChecked="True" TabIndex="90" Margin="5,0,0,0" Foreground="{DynamicResource InputFontColor}"/>
            <RadioButton Content="Female" x:Name="FemaleRadioButton" TabIndex="95" Margin="5,0,0,0" Foreground="{DynamicResource InputFontColor}"/>
          </StackPanel>
        </StackPanel>

        <StackPanel Grid.Row="1" Margin="10,0,0,0">
          <Label Content="_First Name" Target="{Binding ElementName=FirstNameInputTextBox, Mode=OneWay}" Foreground="{DynamicResource InputFontColor}"/>
          <TextBox TextWrapping="Wrap" x:Name="FirstNameInputTextBox" HorizontalAlignment="Left" Width="130" Margin="5,0,0,0" TabIndex="100"/>
          <Label Content="Date of _Birth" Target="{Binding ElementName=BirthDateInputTextBox, Mode=OneWay}" Foreground="{DynamicResource InputFontColor}"/>
          <TextBox TextWrapping="Wrap" x:Name="BirthDateInputTextBox" HorizontalAlignment="Left" Width="130" Margin="5,0,0,0" TabIndex="120"/>
        </StackPanel>

        <StackPanel Grid.Row="1" Grid.Column="1">
          <Label Content="_Last Name" Target="{Binding ElementName=LastNameInputTextBox, Mode=OneWay}" Foreground="{DynamicResource InputFontColor}" />
          <TextBox TextWrapping="Wrap" x:Name="LastNameInputTextBox" Width="130" HorizontalAlignment="Left" Margin="5,0,0,0" TabIndex="110"/>
          <Label Content="_Place of Birth" Target="{Binding ElementName=BirthPlaceInputTextBox, Mode=OneWay}" Foreground="{DynamicResource InputFontColor}" />
          <TextBox TextWrapping="Wrap" x:Name="BirthPlaceInputTextBox" Width="130" HorizontalAlignment="Left" Margin="5,0,0,0" TabIndex="130"/>
        </StackPanel>

        <StackPanel Grid.Row="2" Grid.ColumnSpan="2" Margin="15,15,15,15" Orientation="Horizontal" HorizontalAlignment="Left" VerticalAlignment="Stretch">
          <Button Content="_Add" x:Name="AddButton" VerticalAlignment="Bottom" IsDefault="True" HorizontalAlignment="Left" Click="AddButton_Click" TabIndex="140"/>
          <Button Content="_Close" x:Name="CloseButton" VerticalAlignment="Bottom" IsCancel="True" HorizontalAlignment="Left"  TabIndex="150" Margin="10,0,0,0" Click="CloseButton_Click"/>
        </StackPanel>
      </Grid>
    </Border>

    <!-- Footer -->
    <Border Background="{DynamicResource BackgroundBrush}" Height="35" x:Name="Footer" BorderBrush="{DynamicResource BorderBrush}" BorderThickness="1,0,1,1" CornerRadius="0,0,5,5"/>

  </StackPanel>
</UserControl>
